//
//  YFCategoryVCLeftCell.m
//  QuanJieShopProject
//
//  Created by apple on 2018/4/25.
//  Copyright © 2018年 apple. All rights reserved.
//

#import "YFCategoryVCLeftCell.h"
@interface YFCategoryVCLeftCell ()
@property (nonatomic, strong) UIView *cellBg;
@property (nonatomic, strong) UILabel *cellTitle;
@end

@implementation YFCategoryVCLeftCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        NSLog(@"width = %f, hegi = %f", frame.size.width, frame.size.height);
        [self makeView];
    }
    return self;
}

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self.contentView addSubview:self.cellBg];
        [self.contentView addSubview:self.cellTitle];
    }
    return self;
}

- (void)makeView {

//    UIView *cellBg = [UIView alloc] ini;

}

-(UIView *)cellBg {
    if (!_cellBg) {
        _cellBg = [[UIView alloc] init];
        _cellBg.frame = CGRectMake(0, 0, 120.f/375.f * UISCREEN_WIDTH, 50);
    }
    return _cellBg;
}

- (UILabel *)cellTitle {
    if (!_cellTitle) {
        _cellTitle = [[UILabel alloc] init];
        _cellTitle.frame = CGRectMake(0, 0, 120.f/375.f * UISCREEN_WIDTH, 50);
    }
    return _cellTitle;
}

- (void)cellUpdateWithModel:(CategoryLeftModel *)model {
    if (model) {
        self.cellTitle.text = [NSString stringWithoutNilFormart:model.name];
        NSString *clickStr = [NSString stringWithoutNilFormart:model.ifClick];
        if ([clickStr isEqualToString:@"1"]) {
            self.cellBg.backgroundColor = [UIColor whiteColor];
            self.cellTitle.textColor = HexRGB(0x29b5de);
        }else{
            self.cellBg.backgroundColor = HexRGB(0xe6e6e6);
            self.cellTitle.textColor = HexRGB(0x333333);
        }
    }
}
@end
